import React from 'react';
import { Select, Input } from 'antd';
import { Querier } from '@/components';

/**
 * 列表查询
 */
function DialogListQuery(props) {
    const { deviceTypeOptions, form, onQuery } = props;

    return (
        <Querier
            form={form}
            items={[
                {
                    label: '设备类型',
                    name: 'device_type_name',
                    initialValue: undefined,
                    children: (
                        <Select
                            allowClear
                            showSearch
                            optionFilterProp="label"
                            options={deviceTypeOptions}
                            placeholder="请选择"
                        />
                    ),
                },
                {
                    label: '逻辑名称',
                    name: 'logic_name',
                    initialValue: '',
                    children: <Input allowClear placeholder="请输入逻辑名称" />,
                },
                {
                    label: 'SN序列号',
                    name: 'sn',
                    initialValue: '',
                    children: <Input allowClear placeholder="请输入SN序列号" />,
                },
            ]}
            onQuery={onQuery}
        />
    );
}

export default DialogListQuery;
